﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ProductList.aspx.cs" Inherits="Crm_ProductList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="crm.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery-1.2.6.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function()
        {
            var selobj = null;
            var selobjcolor = null;
            //d = this.style.backgroundColor; this.style.backgroundColor = '#D1F880';
            $(".trnei,.lupai").each(function()
            {

                $(this).click(function()
                {
                    try
                    {
                        selobj.css("background-color", selobjcolor);
                    }
                    catch (ex)
                    {
                    }
                    selobjcolor = $(this).css("background-color");
                    $(this).css("background-color", "#D1F880");
                    selobj = $(this);
                });
            });

        });
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div style="padding: 0 5px;">
        <div class="nav">
            当前位置：产品列表</div>
        <div style="margin-bottom: 5px;">
            <a href="EditProduct.aspx" style="margin: 5px;">添加产品</a></div>
        <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource1" DataKeyNames="ID" AllowPaging="True" >
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" />
                <asp:BoundField DataField="ProductNo" HeaderText="编号" SortExpression="ProductNo" />
                <asp:BoundField DataField="product_name" HeaderText="产品名称" SortExpression="product_name" />
              
                <asp:BoundField DataField="showtime" HeaderText="上市时间" SortExpression="showtime" />
                <asp:BoundField DataField="size" HeaderText="尺寸" SortExpression="size" />
               
                <asp:BoundField DataField="cateId" HeaderText="分类ID" SortExpression="cateId" />
                <asp:BoundField DataField="price" HeaderText="价格" SortExpression="price" />
                <asp:BoundField DataField="cur_time" HeaderText="发布时间" SortExpression="cur_time" />
                <asp:TemplateField HeaderText="操作" ItemStyle-Width="100px">
                    <ItemTemplate>
                        <a href="EditProduct.aspx?id=<%#Eval("id") %>">编辑</a>
                    </ItemTemplate>
                    <ItemStyle Width="100px"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" OnClientClick="return confirm('确认要删除吗？');" runat="server" CausesValidation="False" CommandName="Delete" Text="删除"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/flashcrm.mdb" DeleteCommand="DELETE FROM [Product] WHERE ([ID] = ?)" InsertCommand="INSERT INTO [Product] ([ID], [ProductNo], [product_name], [mianliao], [showtime], [size], [sextype], [cateId], [contents], [price], [cur_time]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" SelectCommand="SELECT * FROM [Product]" UpdateCommand="UPDATE [Product] SET [ProductNo] = ?, [product_name] = ?, [mianliao] = ?, [showtime] = ?, [size] = ?, [sextype] = ?, [cateId] = ?, [contents] = ?, [price] = ?, [cur_time] = ? WHERE (([ID] = ?) OR ([ID] IS NULL AND ? IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="ProductNo" Type="String" />
            <asp:Parameter Name="product_name" Type="String" />
            <asp:Parameter Name="mianliao" Type="String" />
            <asp:Parameter Name="showtime" Type="String" />
            <asp:Parameter Name="size" Type="String" />
            <asp:Parameter Name="sextype" Type="String" />
            <asp:Parameter Name="cateId" Type="Int32" />
            <asp:Parameter Name="contents" Type="String" />
            <asp:Parameter Name="price" Type="String" />
            <asp:Parameter Name="cur_time" Type="DateTime" />
            <asp:Parameter Name="ID" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="ID" Type="String" />
            <asp:Parameter Name="ProductNo" Type="String" />
            <asp:Parameter Name="product_name" Type="String" />
            <asp:Parameter Name="mianliao" Type="String" />
            <asp:Parameter Name="showtime" Type="String" />
            <asp:Parameter Name="size" Type="String" />
            <asp:Parameter Name="sextype" Type="String" />
            <asp:Parameter Name="cateId" Type="Int32" />
            <asp:Parameter Name="contents" Type="String" />
            <asp:Parameter Name="price" Type="String" />
            <asp:Parameter Name="cur_time" Type="DateTime" />
        </InsertParameters>
    </asp:AccessDataSource>
    </form>
</body>
</html>
